package com.itcv.leetcode.low;

public class RemoveRepeatNum {

    public static void main(String[] args) {
          RemoveRepeatNum repeatNum = new RemoveRepeatNum();
          int nums[] ={1,1,2,2,3,4,5,5,6};
          int i = repeatNum.removeDuplicates(nums);
           System.out.println(i);
    }

    public int removeDuplicates(int[] nums){
        int t =0;
        for(int i =0;i<nums.length;i++){
            if(i==0 || nums[i]!=nums[i-1]){
                nums[t++] = nums[i];
                //t++;
            }
        }
        return t;
    }


}
